$package('Bdth.HisAlarm');
Bdth.HisAlarm = function () {
	var _box = null;
	var startTime = new Date().Format("yyyy-MM-dd") + " 00:00:00";
	var endTime = new Date().Format("yyyy-MM-dd") + " 23:59:59";
	var _this = {
		config: {
			dataGrid: {
				title: '报警数据列表',
				url: path + '/alarm/dataList',
				queryParams: {"startTime": startTime, "endTime": endTime},
				columns: [[
					{title: '显示名称', field: 'equipName', width: 80, sortable: false},
					{title: '设备号', field: 'simNo', width: 80, sortable: false},
					{title: '所属分组', field: 'depName', width: 120, sortable: false},
					{title: '报警类型', field: 'alarmType', width: 100, sortable: false},
					{
						title: '报警来源', field: 'alarmSource', width: 70, sortable: false,
						formatter: function (value, rowData, rowIndex) {
							if (value == "terminal") {
								return "终端报警";
							} else if (value == "platform") {
								return "平台报警";
							} else {
								return "";
							}
						}
					},
					{title: '报警时间', field: 'alarmTime', width: 120, sortable: false},
					{field: 'orgLongitude', title: '经度', width: 120, sortable: false},
					{field: 'orgLatitude', title: '纬度', width: 120, sortable: false},
					{field: 'speed', title: '速度', width: 40, sortable: false},
					/*	{title: '报警地点', field: 'location', width: 300, sortable: false},
					{
						title: '处理状态',
						field: 'processed',
						width: 80,
						sortable: false,
						formatter: function (value, rowData, rowIndex) {
							if (value == 0) {
								return "未处理";
							} else {
								return "已处理";
							}
						}
					}, */
				]]
			},
		},
		init: function () {
			_box = new DataGrid(_this.config);
			_box.init();
		}
	}
	return _this;
}();

$(function () {
	Bdth.HisAlarm.init();
});		